<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<div id="app">
		<h1>{{title}}</h1>
		<div>
			<ul>
				<li v-for="item in searchWords" :key="item.id">
					<a href="javascript:;" v-on:click="hitHotword(item.word)">{{item.word}}</a>
				</li>
			</ul>
		</div>
	</div>

	<script src="https://cdn.bootcss.com/vue/2.5.16/vue.min.js"></script>
	<script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>
	<script>
		var vm = new Vue({
			el: '#app',
			data: function(){
				return {
					title: "Vue Test",
	      			searchWords:[]
      			}
			},
			methods:{
				hitHotword:function(word){
					alert("1");
				}
			},
			created: function(){
				//获取搜索热词
				axios.get('http://api.mianshaquan.cn/v1/search/searchhotword').then((response)=>{
					var lists = response.data.data;
					//console.log(response.data.data);
					this.searchWords = lists
				});
			},
		});
	</script>
</body>
</html>